package org.jash.sportnews2109.dao

import androidx.room.Dao
import androidx.room.Query
import androidx.room.Upsert
import io.reactivex.rxjava3.core.Observable
import org.jash.sportnews2109.entity.Video

@Dao
interface VideoDao {
    @Upsert
    fun save(vararg news:Video)
    @Query("select * from video")
    fun findAll():Observable<List<Video>>
    @Query("select * from video where id=:id")
    fun findById(id:Int):Observable<Video>
    @Query("select * from video where title like :key")
    fun searchByKeyword(key:String):Observable<List<Video>>
}